const express = require('express');
const router = express.Router();
const { getAllBanners, setBanners } = require("../service/bannerServie");
const { formatResponseBody } = require("../utils/tools")

router.get("/", async (req, res, next) => {
    const data = await getAllBanners();
    res.send(formatResponseBody({ data }))
})

router.post("/", async (req, res, next) => {
    const data = await setBanners(req.body)

    res.send(formatResponseBody({ data }))
})

module.exports = router;